using System;

namespace Update.Utils.Interfaces
{
    /// <summary>
    /// 配置管理类接口
    /// </summary>
    public interface IConfigManager
    {
        /// <summary>
        /// 加载配置
        /// </summary>
        /// <returns>是否成功加载</returns>
        bool LoadConfig();

        /// <summary>
        /// 保存配置
        /// </summary>
        /// <returns>是否成功保存</returns>
        bool SaveConfig();

        /// <summary>
        /// 更新配置值
        /// </summary>
        /// <param name="key">键</param>
        /// <param name="value">值</param>
        void UpdateValue(string key, string value);

        /// <summary>
        /// 获取配置值
        /// </summary>
        /// <param name="key">键</param>
        /// <param name="defaultValue">默认值</param>
        /// <returns>配置值</returns>
        string GetValue(string key, string defaultValue = "");

        /// <summary>
        /// 获取布尔值
        /// </summary>
        /// <param name="key">键</param>
        /// <param name="defaultValue">默认值</param>
        /// <returns>配置布尔值</returns>
        bool GetBoolValue(string key, bool defaultValue = false);

        /// <summary>
        /// 获取整数值
        /// </summary>
        /// <param name="key">键</param>
        /// <param name="defaultValue">默认值</param>
        /// <returns>配置整数值</returns>
        int GetIntValue(string key, int defaultValue = 0);

        /// <summary>
        /// 是否已加载
        /// </summary>
        bool IsLoaded { get; }

        /// <summary>
        /// 配置文件路径
        /// </summary>
        string ConfigFilePath { get; }

        /// <summary>
        /// 设置配置文件路径
        /// </summary>
        /// <param name="path">路径</param>
        void SetConfigFilePath(string path);

        // 常用配置属性
        bool DebugMode { get; set; }
        string ServerUrl { get; set; }
        string ServerType { get; set; }
        string TargetAppPath { get; set; }
        string TargetAppExe { get; set; }
        string LocalVersion { get; set; }
        string AccessToken { get; set; }
        string RepoOwner { get; set; }
        string RepoName { get; set; }
        string FilePwd { get; set; }
        bool UseLocalPackage { get; set; }
        string LocalPackagePath { get; set; }
        string SimulateVersion { get; set; }
        bool VerboseLogging { get; set; }
        bool ForceOverwrite { get; set; }
        bool AutoTerminateProcesses { get; set; }
    }
} 